﻿using JelleDruyts.Web.Mvc.Paging;
using Mayando.Web.Models;

namespace Mayando.Web.ViewModels
{
    public class GalleryViewModel
    {
        public Gallery Gallery { get; private set; }
        public PhotosViewModel Photos { get; private set; }

        public GalleryViewModel(Gallery gallery, PhotosViewModel photos)
        {
            this.Gallery = gallery;
            this.Photos = photos;
        }

        public string GetCoverPhotoUrl(string defaultUrl)
        {
            if(this.Gallery.CoverPhoto != null)
            {
                return this.Gallery.CoverPhoto.UrlSmallestAvailable;
            }
            else
            {
                return defaultUrl;
            }
        }
    }
}